$(document).ready(function(){
	
	var FJID= $("#DIS_FJID").text();
	var HmtlNameID = $("#DIS_HtmlName").text();
	if(HmtlNameID!==null && HmtlNameID.length>0){
		$("#uploadFrame").attr("src","/ag/hmkuploads/"+HmtlNameID);
	}else{
		$("#uploadFrame").attr("src","/ag/hmk/MyHtml.html"); //hmk/doc/law1.doc
	}
	/*
	if(FJID!==null){
		$("#uploadFrame").attr("src","hmkuploads/"+FJID);
		//$("#uploadFrame").attr("src","hmk/doc/law1.doc");
	}else{
		$("#uploadFrame").attr("src",""); //hmk/doc/law1.doc
	}*/
	
	//下载附件
	$("#downLoadFileID").click(function(){
		var caseID = $("#caseID").text();
		window.location.href="/ag/hmk/HMKdownload.action?caseID="+caseID+"&findtype=1";
	});
	
	//编辑案例
	$("#EDIT_caseID").click(function(){
		var caseID = $("#caseID").text();
		window.location.href="/ag/hmk/findOneCase_findOneCase.action?caseID1="+caseID; //+"&findType1=1";
	});
	
	//编辑案例
	$("#EDIT_caseID").click(function(){
		var caseID = $("#caseID").text();
		window.location.href="/ag/hmk/findOneCase_findOneCase.action?caseID1="+caseID+"&findType1=1";
	});
	
	//删除案例
	$("#DEL_caseID").click(function(){
		var isPass = confirm("确定要删除吗？");
		if(isPass){
			var caseID = $("#caseID").text();
			var url = 'hmk/delCase_delCase.action';
			var params = {
				caseID1:caseID
			}; 
			jQuery.post(url, params, delData, 'json');
		}
		
	});
	
	//返回案例列表
	$("#BACK_caseList").click(function(){
		window.location.href="/ag/hmk/CaseMain.jsp";
	});
	
	
});


function delData(data){
	if(data.delString=='1'){
		alert("删除成功");
		window.location.replace("/ag/hmk/CaseMain.jsp");
	 }else{
		alert("删除失败");
	 }
}